Document that a print operation can be run only once, and add a
authorMatthias Clasen <mclasen@redhat.com>
Sun, 29 Apr 2007 18:55:12 +0000 (18:55 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 29 Apr 2007 18:55:12 +0000 (18:55 +0000)
2007-04-29  Matthias Clasen <mclasen@redhat.com>

        * gtk/gtkprintoperation.c (gtk_print_operation_run): Document
        that a print operation can be run only once, and add a
        corresponding g_return_if_fail().   (#379399, Masao Mutoh)

svn path=/trunk/; revision=17715

ChangeLog
gtk/gtkprintoperation.c

index 5cfa55373522a2e566b15d5d48f3328728686f7f..09f5c69966ddd3bfd4764fa58a83267f04e8dbb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-29  Matthias Clasen <mclasen@redhat.com>
+
+       * gtk/gtkprintoperation.c (gtk_print_operation_run): Document
+       that a print operation can be run only once, and add a 
+       corresponding g_return_if_fail().   (#379399, Masao Mutoh)
+
 2007-04-29  Dan Winship  <danw@novell.com>
 
        * gdk/x11/gdkdisplay-x11.c
index 80a773c5732e9fb193d2a6d08bf06a727cca065b..77362b43027563777751ed2ec0ffacbb6deb4197 100644 (file)
@@ -2305,8 +2305,7 @@ gtk_print_operation_get_error (GtkPrintOperation  *op,
  * @error: Return location for errors, or %NULL
  * 
  * Runs the print operation, by first letting the user modify
- * print settings in the print dialog, and then print the
- * document.
+ * print settings in the print dialog, and then print the document.
  *
  * Normally that this function does not return until the rendering of all 
  * pages is complete. You can connect to the ::status-changed signal on
@@ -2354,6 +2353,9 @@ gtk_print_operation_get_error (GtkPrintOperation  *op,
  *  }
  * </programlisting></informalexample>
  *
+ * Note that gtk_print_operation_run() can only be called once on a
+ * given #GtkPrintOperation.
+ *
  * Return value: the result of the print operation. A return value of 
  *   %GTK_PRINT_OPERATION_RESULT_APPLY indicates that the printing was
  *   completed successfully. In this case, it is a good idea to obtain 
@@ -2378,9 +2380,10 @@ gtk_print_operation_run (GtkPrintOperation        *op,
   
   g_return_val_if_fail (GTK_IS_PRINT_OPERATION (op), 
                         GTK_PRINT_OPERATION_RESULT_ERROR);
-
+  g_return_val_if_fail (op->priv->status == GTK_PRINT_STATUS_INITIAL,
+                        GTK_PRINT_OPERATION_RESULT_ERROR);
   priv = op->priv;
-
+  
   run_print_pages = TRUE;
   do_print = FALSE;
   priv->error = NULL;